package com.bcx.crm.java.thread.concurrence;

import com.bcx.crm.core.BaseTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Auther: yangshen
 * @Date:2019/4/27 20:40
 */
public class test extends BaseTest {

    @Autowired
    private HelloService helloService;

    @Test
    public void test() throws InterruptedException {
        long currentTimeMillis = System.currentTimeMillis();
        //模拟1000个线程并发
        CountDownLatchUtil countDownLatchUtil = new CountDownLatchUtil(1000);
        countDownLatchUtil.latch(() -> {
        helloService.sayHello(currentTimeMillis);
        });
    }
}
